Skip to content

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Oct 25, 2025

Summary

Fixes intermittent test failures in ResourceInitialSelectionTest on macOS systems.

Problem

Tests testMultiSelectionAndOneInitialSelectionWithInitialPattern and testSingleSelectionAndNoInitialSelectionWithInitialPattern were failing intermittently on macOS with errors indicating that expected selections were not being applied.

The root cause was a race condition between:

  1. The test's explicit dialog.refresh() call
  2. Asynchronous background jobs that populate the dialog content (FilterHistoryJob → FilterJob → RefreshCacheJob → RefreshJob)
  3. The selection application logic

Tests were checking the selection state before background jobs completed, resulting in empty or incorrect selections.

Solution

Added event loop processing to allow background jobs to complete before making assertions:

  1. Added waitForDialogRefresh() helper method that:

    • Processes UI events multiple times with small delays
    • Allows background jobs to complete before assertions
    • Follows the same pattern as the recent fix in DecoratorAdaptableTests
  2. Updated 10 test methods to call waitForDialogRefresh() after dialog.refresh() for tests that expect valid selections

  3. 3 tests intentionally skip the wait to test edge cases where invalid/filtered selections should not cause any selection

Test Results

✅ All 13 tests now pass consistently (verified with multiple runs)

  • Tests run: 13, Failures: 0, Errors: 0, Skipped: 0

Related Issues

Fixes #294

🤖 Generated with Claude Code

@vogella vogella force-pushed the fix-resource-initial-selection-test-race-condition branch from 435d7f8 to e54fe1c Compare October 25, 2025 09:44
@github-actions
Copy link
Contributor

github-actions bot commented Oct 25, 2025

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 11m 0s ⏱️ - 1m 16s
 8 234 tests ±0   7 985 ✅ ±0  249 💤 ±0  0 ❌ ±0 
23 622 runs  ±0  22 828 ✅ ±0  794 💤 ±0  0 ❌ ±0 

Results for commit 05c69a5. ± Comparison against base commit c6e9f0f.

♻️ This comment has been updated with latest results.

…op processing

This commit fixes intermittent test failures on macOS reported in GitHub issue eclipse-platform#294.

The root cause was a race condition between the test's explicit dialog.refresh()
call and asynchronous background jobs (FilterHistoryJob → FilterJob → RefreshCacheJob
→ RefreshJob) that populate the dialog content. Tests were checking selection state
before background jobs completed.

Changes:
- Added waitForDialogRefresh() helper method that processes UI events with delays
- Updated 10 tests to call waitForDialogRefresh() after dialog.refresh()
- 3 tests intentionally skip the wait to test edge cases with invalid selections

All 13 tests now pass consistently (verified with multiple runs).

Fixes: eclipse-platform#294

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vogella vogella force-pushed the fix-resource-initial-selection-test-race-condition branch from f10c95d to 05c69a5 Compare November 5, 2025 08:15
@vogella
Copy link
Contributor Author

vogella commented Nov 6, 2025

If no one issues concerns, I plan to merge tomorrow.

cc @HeikoKlare @fedejeanne @sratz

@vogella vogella merged commit 87352d6 into eclipse-platform:master Nov 7, 2025
18 checks passed
@vogella vogella deleted the fix-resource-initial-selection-test-race-condition branch November 7, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some ResourceInitialSelectionTest tests fail intermittently

1 participant